package com.wanwu.channel.remote.allinpay.http.req;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.lang.reflect.Field;

/**
 * @ClassName TlDeclareHttpReq
 * @Description 通联报关接口
 * @Author husheng
 * @Date 2020-01-21 14:34
 */
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
@JacksonXmlRootElement(localName = "BODY")
public class TlDeclareHttpReq {

    @JacksonXmlProperty(localName = "CUSTOMS_CODE")
    @JSONField(name = "CUSTOMS_CODE")
    private String customsCode;

    @JacksonXmlProperty(localName = "PAYMENT_CHANNEL")
    @JSONField(name = "PAYMENT_CHANNEL")
    private String paymentChannel;

    @JacksonXmlProperty(localName = "CUS_ID")
    @JSONField(name = "CUS_ID")
    private String cusId;

    @JacksonXmlProperty(localName = "PAYMENT_DATETIME")
    @JSONField(name = "PAYMENT_DATETIME")
    private String paymentDatetime;

    @JacksonXmlProperty(localName = "MCHT_ORDER_NO")
    @JSONField(name = "MCHT_ORDER_NO")
    private String mchtOrderNo;

    @JacksonXmlProperty(localName = "PAYMENT_ORDER_NO")
    @JSONField(name = "PAYMENT_ORDER_NO")
    private String paymentOrderNo;

    @JacksonXmlProperty(localName = "PAYMENT_AMOUNT")
    @JSONField(name = "PAYMENT_AMOUNT")
    private String paymentAmount;

    @JacksonXmlProperty(localName = "CURRENCY")
    @JSONField(name = "CURRENCY")
    private String currency;

    @JacksonXmlProperty(localName = "ESHOP_ENT_CODE")
    @JSONField(name = "ESHOP_ENT_CODE")
    private String eshopEntCode;

    @JacksonXmlProperty(localName = "ESHOP_ENT_NAME")
    @JSONField(name = "ESHOP_ENT_NAME")
    private String eshopEntName;

    @JacksonXmlProperty(localName = "BIZ_TYPE_CODE")
    @JSONField(name = "BIZ_TYPE_CODE")
    private String bizTypeCode;

    @JacksonXmlProperty(localName = "PAYER_NAME")
    @JSONField(name = "PAYER_NAME")
    private String payerName;

    @JacksonXmlProperty(localName = "PAPER_TYPE")
    @JSONField(name = "PAPER_TYPE")
    private String paperType;

    @JacksonXmlProperty(localName = "PAPER_NUMBER")
    @JSONField(name = "PAPER_NUMBER")
    private String paperNumber;

    @JacksonXmlProperty(localName = "PAPER_PHONE")
    @JSONField(name = "PAPER_PHONE")
    private String paperPhone;

    @JacksonXmlProperty(localName = "MEMO")
    @JSONField(name = "MEMO")
    private String memo;

    @JacksonXmlProperty(localName = "MAIN_PAYMENT_ORDER_NO")
    @JSONField(name = "MAIN_PAYMENT_ORDER_NO")
    private String mainPaymentOrderNo;

    @Override
    public String toString() {
        return (new ReflectionToStringBuilder(this, ToStringStyle.JSON_STYLE) {
            @Override
            protected boolean accept(Field f) {
                return super.accept(f) && !f.getName().equals("paperNumber") && !f.getName().equals("payerName") && !f.getName().equals("paperPhone") ;
            }
        }).toString();
    }
}
